

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script type="text/javascript" src="helpman_topicinit.js"></script>

<title>Class [Enterprise Architect User Guide]</title>

<meta name="keywords" content="Enterprise Architect, Sparx Systems, UML, Element,Element Class,Class,Class Element">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />

<link type="text/css" href="default.css" rel="stylesheet" />
<style type="text/css">
  A, A:Visited
  {
    color: #00F;
  }

  A:Active, A:Hover
  {
    color: #F00;
  }

  OL
  {
    margin: 5px 0 5px 48px;
  }

  UL
  {
    margin-bottom: 3px;
    margin-top: 0;
  }

  #nsr
  {
    background-color: #D4DFFF;
  }

  #nsr A
  {
    text-decoration: none;
  }

  #mainbody
  {
    padding: 8px;
  }

  .p_BodyText
  {
    padding: 5px 0;
  }
</style>



<style type="text/css" media="screen">
  BODY
  {
    background-color: #FFFFFF;
  }

  #nsr
  {
    padding: 6px 6px 0 6px;
    border-bottom: none;
    vertical-align: top;
    z-index: 2;
    visibility: visible;
    left: 0;
    top: 0;
    position: absolute;
  }

  #mainbody
  {
    left: 0;
    top: 0;
    margin: 0;
    position: absolute;
    padding: 10px;
    overflow: auto;
    height: 100%;
    z-index: 1;
    background-repeat: no-repeat;
    background-position: bottom right;
    background-attachment: fixed;
  }
</style>

<style type="text/css" media="print">
  #nsr
  {
    visibility: none;
  }

  #mainbody
  {
    overflow: visible;
  }
</style>
<script type="text/javascript" language="JavaScript" src="nonscroll.js"></script>

</head>
<body scroll="no">

<div id="page">



        <div id="content">
          <div id="content-inner">
          



  
          <div id="nsr">
            <table border="0" cellspacing="0" cellpadding="4" width="100%">
              <tr valign="top">
                <td align="left">
  


                  <p class="p_Heading1"><span class="f_Heading1">Class</span></p>



  
                </td>
                <td align="right">
                  <a href="introduction.htm" onmouseover="document.images.main.src='button_main_h.gif'" onmouseout="document.images.main.src='button_main.gif'">
                    <img name="main" src="button_main.gif" border=0 alt="Return to Introduction">
                  </a>&nbsp;
    
                  <a href="artifact.htm" onmouseover="document.images.prev.src='button_prev_h.gif'" onmouseout="document.images.prev.src='button_prev.gif'">
                    <img name=prev src="button_prev.gif" border=0 alt="Previous page" />
                  </a>&nbsp;
    
    
    
                  <a href="activeclasses.htm" onmouseover="document.images.next.src='button_next_h.gif'" onmouseout="document.images.next.src='button_next.gif'">
                    <img name=next src="button_next.gif" border=0 alt="Next page" />
                  </a>
    
    
                </td>
              </tr>
            </table>
          </div>
          <div id="mainbody">
  


                <p class="p_TextIndentedL2"><img src="d_class.png" width="113" height="95" border="0" alt="d_Class"></p>
<p class="p_BodyText"><span class="f_BodyText">A </span><span class="f_BodyText" style="font-style: italic;">Class</span><span class="f_BodyText"> is a representation of objects that reflects their structure and behavior within the system. It is a template from which actual running instances are created, although a Class can be defined either to <a href="activeclasses.htm">control its own execution</a> or as a </span><span class="f_BodyText" style="font-style: italic;">template</span><span class="f_BodyText"> or </span><span class="f_BodyText" style="font-style: italic;"><a href="parameterisedclassestemplate.htm">parameterized Class</a> </span><span class="f_BodyText">that</span><span class="f_BodyText"> specifies parameters that must be defined by any binding Class.</span></p>
<p class="p_BodyText"><span class="f_BodyText">A Class can have </span><span class="f_BodyText" style="font-style: italic;"><a href="attributes.htm">attributes</a> </span><span class="f_BodyText">(data) and </span><span class="f_BodyText" style="font-style: italic;">methods</span><span class="f_BodyText"> (</span><span class="f_BodyText" style="font-style: italic;"><a href="operations.htm">operations</a></span><span class="f_BodyText"> or behavior). Classes can inherit characteristics from parent Classes and delegate behavior to other Classes. Class models usually describe the logical structure of the system and are the building blocks from which components are built.</span></p>
<p class="p_BodyText"><span class="f_BodyText">The top section of a Class, as illustrated below, shows the attributes (or data elements) associated with the Class. These hold the 'state' of an object at run-time. If the information is saved to a data store and can be reloaded, it is termed 'persistent'. The lower section contains the Class operations (or methods at run-time). Operations describe the behavior a Class offers to other Classes, and the internal behavior it has (private methods).</span></p>
<p class="p_BodyText"><span class="f_BodyText">Class elements are generally used in <a href="classdiagram.htm">Class diagrams</a> and <a href="compositestructurediagram.htm">Composite Structure diagrams</a>.</span></p>
<p class="p_BodyText"><span class="f_BodyText">Enterprise Architect also supports a number of stereotyped Class elements to represent various entities in <a href="webstereotypes.htm">web-page modeling</a>.</span></p>
<p class="p_TextIndentedL2"><img src="classemployee.png" width="114" height="96" border="0" alt="ClassEmployee"></p>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Toolbox Icon</span></p>
<p class="p_TextIndentedL2"><img src="e_class.png" width="168" height="23" border="0" alt="e_Class"></p>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">OMG UML Specification</span></p>
<p class="p_BodyText"><span class="f_BodyText">The OMG UML specification (</span><span class="f_BodyText" style="font-style: italic;">UML Superstructure Specification, v2.1.1, pp. 52-53</span><span class="f_BodyText">) states:</span></p>
<p class="p_OMGText"><span class="f_OMGText">The purpose of a class is to specify a classification of objects and to specify the features that characterize the structure and behavior of those objects.</span></p>
<p class="p_OMGText"><span class="f_OMGText">Objects of a class must contain values for each attribute that is a member of that class, in accordance with the characteristics of the attribute, for example its type and multiplicity.</span></p>
<p class="p_OMGText"><span class="f_OMGText">When an object is instantiated in a class, for every attribute of the class that has a specified default, if an initial value of the attribute is not specified explicitly for the instantiation, then the default value specification is evaluated to set the initial value of the attribute for the object.</span></p>
<p class="p_OMGText"><span class="f_OMGText">Operations of a class can be invoked on an object, given a particular set of substitutions for the parameters of the operation. An operation invocation may cause changes to the values of the attributes of that object. It may also return a value as a result, where a result type for the operation has been defined. Operation invocations may also cause changes in value to the attributes of other objects that can be navigated to, directly or indirectly, from the object on which the operation is invoked, to its output parameters, to objects navigable from its parameters, or to other objects in the scope of the operation's execution. Operation invocations may also cause the creation and deletion of objects.</span></p>




            </div>
          </div>
        </div>



</div>


</body>
</html>
